package com.mdb.open.epay.domain.dto.epay;

import com.mdb.bc.api.data.DataObjectBase;
import com.mdb.bc.validator.annotaion.validation.PositiveDigits;
import com.mdb.open.epay.enums.type.CcyTypeEnum;
import com.mdb.open.epay.enums.type.CustTypeEnum;
import com.mdb.open.epay.enums.type.RefundBizTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;

/**
 * @author liuyi
 * @date 2019/11/14
 **/
@Data
@ApiModel(description="退款dto对象")
public class RefundDto extends DataObjectBase {

    private static final long serialVersionUID = 1L;

    /**
     * 客户类型
     */
    @ApiModelProperty(value = "客户类型")
    @NotNull(message = "客户类型不能为空")
    private CustTypeEnum custType;

    /**
     * 業務類型
     */
    @ApiModelProperty(value = "業務類型")
    @NotNull(message = "業務類型不能为空")
    private RefundBizTypeEnum bizType;

    /**
     * 原支付訂單號
     */
    @ApiModelProperty(value = "原支付訂單號")
    @NotBlank(message = "原支付訂單號不能为空")
    @Size(max = 32)
    private String oriOrderNo;

    /**
     * 幣種
     */
    @ApiModelProperty(value = "幣種")
    @NotNull(message = "幣種不能为空")
    private CcyTypeEnum currency = CcyTypeEnum.MOP;

    /**
     * 退貨訂單號
     */
    @ApiModelProperty(value = "退貨訂單號")
    @NotBlank(message = "退貨訂單號不能为空")
    @Size(max = 32)
    private String reOrderNo;

    /**
     * 退款金額
     */
    @ApiModelProperty(value = "退款金額")
    @NotNull(message = "退款金額不能为空")
//    @Digits(integer = 10, fraction = 2, message = "訂單金額要輸入阿拉伯數字（包含小數點及小數點後兩位最大16位）")
//    @Num(regexp = "^\\+?[1-9][0-9]*+(.[0-9]{1,2})?$", message = "訂單金額要輸入阿拉伯數字（包含小數點及小數點後兩位最大16位）")
    @PositiveDigits(integer = 10, fraction = 2, message = "訂單金額要輸入阿拉伯數字（包含小數點及小數點後兩位最大12位）")
    private BigDecimal backReAmt;

    /**
     * 備註
     */
    @ApiModelProperty(value = "備註")
    @Size(max = 128)
    private String remark;

}